﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace V5_EaspLibs.Core {
    /// <summary>
    /// 模板操作类
    /// </summary>
    public class TplHelper {
        #region
        private static readonly TplHelper m_Instance = new TplHelper();
        /// <summary>
        /// 
        /// </summary>
        public static TplHelper Instance {
            get { return m_Instance; }
        }
        /// <summary>
        /// 
        /// </summary>
        public TplHelper() {

        }
        #endregion
        #region 属性
        private string _FilePath = string.Empty;
        /// <summary>
        /// 模板路径 从根目录开始
        /// </summary>
        public string FilePath {
            get { return _FilePath; }
            set { _FilePath = value; }
        }
        private string _TagUnknown = "comment";
        /// <summary>
        /// 如何处理未替换的标签,"keep"-保留，"remove"-移除，"comment"-转成注释 
        /// </summary>
        public string TagUnknown {
            get { return _TagUnknown; }
            set { _TagUnknown = value; }
        }

        private string _TagTask = "${*}";
        /// <summary>
        /// 模板标签的样式，默认为"${*}"，*号为标签名 
        /// </summary>
        public string TagTask {
            get { return _TagTask; }
            set { _TagTask = value; }
        }
        #endregion
        /// <summary>
        /// 载入模板文件
        /// </summary>
        /// <param name="tplFileName"></param>
        public void Load(string tplFileName) {

        }
        /// <summary>
        /// 设置Block
        /// </summary>
        private void SetBlocks() {

        }
        /// <summary>
        /// 格式化标签
        /// </summary>
        /// <param name="tagName"></param>
        /// <param name="tagValue"></param>
        public void Assign(string tagName, object tagValue) {

        }
        /// <summary>
        /// 块区域
        /// </summary>
        /// <returns></returns>
        private string BlockData() {
            return "";
        }
        /// <summary>
        /// 制作标签
        /// </summary>
        /// <param name="tagName">标签名称</param>
        /// <param name="tagValue">标签内容</param>
        /// <returns></returns>
        public string MakeTag(string tagName, string tagValue) {
            return "";
        }
        /// <summary>
        /// 更新标签
        /// </summary>
        /// <param name="blockName"></param>
        public void Update(string blockName) {

        }
        /// <summary>
        /// 获取生成后的Html
        /// </summary>
        /// <returns></returns>
        public string GetHtml() {
            return "";
        }
    }
}
